package com.hitsf.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class TestController {
    @Autowired
    JdbcTemplate template;

    @RequestMapping("query")
    public Map<String,Object> query(){
        List<Map<String,Object>> list = template.queryForList("SELECT * FROM department");
        return list.get(0);
    }
}
